<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@page import="myicesscheduler.web.MyFileInfo"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<LINK href="css/lectureList.css" rel="stylesheet" type="text/css">
<title>Administration page for ICES scheduler</title>
</head>
<body text="#000000" marginwidth="0" marginheight="0" bgcolor="#8899FF"
  onload="window.name = 'main';" topmargin="0" leftmargin="0">

<center><%@ include file="/WEB-INF/jsp/header1.jsp"%> <form:form
  method="post" commandName="adminMenuCommand" enctype="multipart/form-data">
  <table width="760" border="0" bgcolor="#FFFFFF">
    <tr>
      <td align="center">
      <h1 class="admin_notice">*** Welcome Administrator ***</h1>
      </td>
    </tr>

    <tr>
      <td>
      <h3>Lecture:</h3>
      <ul>
        <LI>
        <button onClick="location.assign('<c:url value="adminLecture.spring"/>');">Add a
        new lecture schedule</button>
        </LI>
      </ul>
      </td>
    </tr>

    <tr>
      <td>
      <hr />
      </td>
    </tr>

    <tr>
      <td>
      <h3>Backup:</h3>
      <ul>
        <LI>
        <button onClick="location.assign('<c:url value="adminMenu.backup.compress.spring"/>');">Compress
        database and upload files</button>
        ; this will take some time and delete old backup files.<br />
        <a name="CompressedFiles"><b>Compressed files</b></a>
        <ol>
          <c:forEach items="${backupFiles}" var="backupFile">
            <li><c:out value="${backupFile.filename}" /> (<c:out
              value="${backupFile.fileSizeInMegaByte}" />MB)
            <button
              onClick="location.assign('fileDownload.spring?folder=${backupFile.dir}&file=${backupFile.filename}');">
            Download</button>
            </li>
          </c:forEach>
        </ol>
        </LI>
      </ul>

      <h4>Note:</h4>
      <ol>
        <li>Backup/restore feature will allow us to change web hosting company any time.</li>
        <li>Backup process does NOT include web application; it only compress database and PDF
        files. Thus, we can <b>UPGRADE</b> the web application after you back up the database and
        PDF files; 1) backup 2) upgrade 3) restore</li>
        <li>There are two different types of backup files: UPLOAD backup and DATABASE backup.
        UPLOAD backup is backup data for PDF or other files that are related to lectures. DATABASE
        backup is backup data for each lecture schedule information.</li>
      </ol>
      </td>
    </tr>

    <tr>
      <td>
      <hr />
      </td>
    </tr>

    <tr>
      <td>
      <h3>Restore:</h3>
      <ul>
        <LI>Restore UPLOAD backup files:
        <ul>
          <c:forEach var="i" begin="0" end="4" step="1">
            <li><input type="file" size="50" name="uploadBackups<c:out value="${i}"/>" /> #<c:out
              value="${i}" /></li>
          </c:forEach>

          <li>After you select files to send, click
          <button
            onClick="location.assign('<c:url value="adminMenu.backup.restore.spring?target=upload"/>');">Send
          </button>
          button.</li>
        </ul>

        <a name="UploadFilesToRestore"><b>Files to restore:</b></a>
        <ol>
          <c:forEach items="${restoreUploadBackupFiles}" var="restoreUploadBackupFile">
            <li><c:out value="${restoreUploadBackupFile.filename}" /> (<c:out
              value="${restoreUploadBackupFile.fileSizeInMegaByte}" />MB)
            <button>Restore</button>
            <button>Delete</button>
            </li>
          </c:forEach>
        </ol>
        </LI>
      </ul>

      <ul>
        <LI>Restore DATABASE files:
        <ul>
          <c:forEach var="i" begin="0" end="4" step="1">
            <li><input type="file" size="50" name="dbBackups<c:out value="${i}"/>" /> #<c:out
              value="${i}" /></li>
          </c:forEach>

          <li>After you select database backup files, click
          <button
            onClick="location.assign('<c:url value="adminMenu.backup.restore.spring?target=db"/>');">Send
          </button>
          button.</li>

          <li>After you send every database backup files, click
          <button>Restore DATABASE backup</button>
          to restore the database.</li>
        </ul>

        <a name="DatabaseFilesToRestore"><b>Files to restore:</b></a>
        <ol>
          <c:forEach items="${restoreDatabaseBackupFiles}" var="restoreDatabaseBackupFile">
            <li><c:out value="${restoreDatabaseBackupFile.filename}" /> (<c:out
              value="${restoreDatabaseBackupFile.fileSizeInMegaByte}" />MB)</li>
          </c:forEach>
        </ol>
        </LI>

      </ul>

      <h4>Note:</h4>
      <ol>
        <li>Click "Browse" and select file to send.</li>
        <li>Click "Send" to send files to the server.</li>
        <li>Click "Restore" to restore each file.</li>
      </ol>
      </td>
    </tr>

    <tr>
      <td>
      <hr />
      </td>
    </tr>

    <tr>
      <td>
      <h3>E-Mail setup:</h3>
      <ul>
        <LI>
        <button>E-Mail set-up</button>
        </LI>
      </ul>
      </td>
    </tr>

  </table>
</form:form> <%@ include file="/WEB-INF/jsp/tail1.jsp"%></center>

</body>
</html>
